Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add fragment.encrypted unit tests for manifest signalled DRM (PlayReady and Widevine) #2735

Merged
merged 3 commits into from
May 17, 2020

Conversation

itsjamie
Copy link
Collaborator

@itsjamie itsjamie commented May 13, 2020

This PR will...

When fragments are signalled from the manifest they are encrypted we
need to be able to detect this fact. Currently we use the boolean
"encrypted" on Fragment to support this. So I've added some tests that
cover the current behaviour for AES-128 encryption, and some skipped
tests that cover the future usecase.

Additionally, this change includes a tiny change to the LevelKey class.
It now has a private constructor, and two static methods to create
itself. fromURL and fromURI, one supports the current usecase for
absolute or relative URLs, and the other is for supporting the future
use-case of URI keys.

As the meaning of the encrypted getter on Fragment has been changed
to mean that a fragment has a EXT-X-KEY associated with it, locations where it was used
currently for determining if a key needed to be loaded have been changed to
directly reference the appropriate properties.

Why is this Pull Request needed?

We need to know when fragments are encrypted beyond the current
support for AES-128 segments if we are going to notify users when
encrypted content is being encountered from a manifest only
perspective.

Are there any points in the code the reviewer needs to double check?

The unit tests make sense.

@itsjamie itsjamie requested review from robwalch and OrenMe May 13, 2020 22:24
@itsjamie itsjamie changed the title Add encrypted unit tests Add Fragment encrypted unit tests for manifest signalled DRM (PlayReady and Widevine) May 13, 2020
@itsjamie itsjamie changed the title Add Fragment encrypted unit tests for manifest signalled DRM (PlayReady and Widevine) Add fragment.encrypted unit tests for manifest signalled DRM (PlayReady and Widevine) May 13, 2020
Copy link
Collaborator

@robwalch robwalch left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'd like to see the url/uri TODO in m3u8-parser addressed here, or with an issue for follow up.

src/loader/fragment.ts Outdated Show resolved Hide resolved
expect(frag.encrypted).to.equal(true);
});

it('returns true for widevine v2 manifest signalled encryption', function () {
Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

while these tests return true, currently, via integration they won't ever be set on the fragment as these keys are currently set as "unknown" keyformats, since we don't handle them as a client yet.

itsjamie added 2 commits May 13, 2020 21:24
When fragments are signalled from the manifest they are encrypted we
need to be able to detect this fact. Currently we use the boolean
"encrypted" on Fragment to support this. So I've added some tests that
cover the current behaviour for AES-128 encryption, and some skipped
tests that cover the future usecase.

Additionally, this change includes a tiny change to the LevelKey class.
It now has a private constructor, and two static methods to create
itself. `fromURL` and `fromURI`, one supports the current usecase for
absolute or relative URLs, and the other is for supporting the future
use-case of URI keys.
We want to download the key not when a fragment reports that it is
encrypted. But specifically when it is an identity key, that hasn't been
loaded already.
@itsjamie itsjamie force-pushed the chore/add-encrypted-unit-tests branch from e108026 to a244799 Compare May 14, 2020 00:24
@itsjamie
Copy link
Collaborator Author

@robwalch #2737 issue up for the url bit as mentioned.

src/loader/m3u8-parser.ts Outdated Show resolved Hide resolved
@itsjamie itsjamie merged commit a6ffd3b into feature/v1.0.0 May 17, 2020
@itsjamie itsjamie deleted the chore/add-encrypted-unit-tests branch May 17, 2020 19:24
@robwalch robwalch added this to the 1.0.0 milestone Aug 12, 2020
@robwalch robwalch added the DRM label Apr 6, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
Development

Successfully merging this pull request may close these issues.

2 participants